
! 文件的基本操作，
!提示输入文件名，且包含若干数据
!输出文件里的内容

program read_file
  implicit none
  character(len=20) :: filename
  integer :: nfringe, nhole, nghost, interp_method, fringe_zone_idx, fi,fj,fk,donor_zone_idx,di,dj,dk,hole_zone_idx, hi,hj,hk,i
  real(8) :: xi,eta,zeta

  open(unit=2, file="test.txt")

  open(unit=3, file="assemble_info.dat",  form='unformatted')
    read(3) nfringe, nhole, nghost, interp_method
    write(*,*) nfringe, nhole
    
    do i = 1, nfringe, 1
        read(3) fringe_zone_idx, fi,fj,fk,donor_zone_idx,di,dj,dk,xi,eta,zeta
        write(2,*) fringe_zone_idx, fi,fj,fk,donor_zone_idx,di,dj,dk,xi,eta,zeta
    end do

    do i = 1, nhole, 1
        read(3) hole_zone_idx, hi,hj,hk
        write(2,*) hole_zone_idx, hi,hj,hk
    end do

  close(unit=3)

  close(unit=2)
end program read_file
